<?php
    global $VISUAL_COMPOSER_EXTENSIONS;
	if ((class_exists('WPBakeryShortCode')) && (!class_exists('WPBakeryShortCode_TS_VCSC_Title_Typed'))) {
		class WPBakeryShortCode_TS_VCSC_Title_Typed extends WPBakeryShortCode {};
	};
    $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VisualComposer_Element = array(
		"name"                      	=> __( "TS Title Typed", "ts_visual_composer_extend" ),
		"base"                      	=> "TS_VCSC_Title_Typed",
		"icon" 	                    	=> "ts-composer-element-icon-title-typed",
		"category"                  	=> __( "Composium", "ts_visual_composer_extend" ),
		"description"               	=> __("Place a title with type effect", "ts_visual_composer_extend"),
		"admin_enqueue_js"        		=> "",
		"admin_enqueue_css"       		=> "",
		"params"                    	=> array(
			// Content Settings
			array(
				"type"              	=> "seperator",
				"param_name"        	=> "seperator_1",
				"seperator"				=> "Title Content",
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Add Prefix String", "ts_visual_composer_extend" ),
				"param_name"            => "fixed_addition",
				"value"                 => "false",
				"description"           => __( "Switch the toggle if you want to add a fixed pre-string to the animated segments.", "ts_visual_composer_extend" ),
			),
			array(
				"type"              	=> "textfield",
				"heading"           	=> __( "Prefix: String", "ts_visual_composer_extend" ),
				"param_name"        	=> "fixed_string",
				"value"             	=> "",
				"description"       	=> __( "Enter an optional fixed text string to be shown before the animated segments.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "fixed_addition", 'value' => 'true' ),
			),				
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Use HTML Code", "ts_visual_composer_extend" ),
				"param_name"            => "title_html",
				"value"                 => "false",
				"description"           => __( "Switch the toggle if you want to use basic HTML code and HTML entities in your title strings.", "ts_visual_composer_extend" ),
			),			
			array(
				"type"                  => "exploded_textarea",
				"heading"               => __( "Title: Strings", "ts_visual_composer_extend" ),
				"param_name"            => "title_strings",
				"value"                 => "",
				"description"           => __( "Enter the individual title strings for the segments to be typed; separate by line break (NO commas, or HTML entities allowed).", "ts_visual_composer_extend" ),
				"dependency"    		=> array( "element" => "title_html", "value" => "false" ),
			),
			array(
				"type"              	=> "textarea_raw_html",
				"heading"           	=> __( "Title: Strings", "ts_visual_composer_extend" ),
				"param_name"        	=> "title_advanced",
				"value"             	=> base64_encode(""),
				"description"      	 	=> __( "Enter the individual title strings for the segments to be animated; separate by line break (basic HTML code and special characters with the exception of '|' allowed).", "ts_visual_composer_extend" ),
				"dependency"    		=> array( "element" => "title_html", "value" => "true" ),
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Add Postfix String", "ts_visual_composer_extend" ),
				"param_name"            => "post_addition",
				"value"                 => "false",
				"description"           => __( "Switch the toggle if you want to add a fixed post-string to the animated segments.", "ts_visual_composer_extend" ),
			),
			array(
				"type"              	=> "textfield",
				"heading"           	=> __( "Postfix: String", "ts_visual_composer_extend" ),
				"param_name"        	=> "post_string",
				"value"             	=> "",
				"description"       	=> __( "Enter an optional fixed text string to be shown after the animated segments.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "post_addition", 'value' => 'true' ),
			),	
			array(
				"type"              	=> "dropdown",
				"heading"           	=> __( "Whitespace Handling", "ts_visual_composer_extend" ),
				"param_name"        	=> "whitespace",
				"width"             	=> 150,
				"value"             	=> array(
					__( "CSS: Pre-Wrap", "ts_visual_composer_extend" )					=> "pre-wrap",
					__( "CSS: Pre", "ts_visual_composer_extend" )                   	=> "pre",
					__( "CSS: Pre-Line", "ts_visual_composer_extend" )					=> "pre-line",
					__( "CSS: NoWrap", "ts_visual_composer_extend" )                   	=> "nowrap",
					__( "CSS: Normal", "ts_visual_composer_extend" )                   	=> "normal",
				),
				"dependency"        	=> array( 'element' => "mobile", 'value' => 'false' ),
				"description"       	=> __( "Select how white space inside the element should be handled. Learn more here:", "ts_visual_composer_extend" ) . ' <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/white-space" target="_blank">white-space</a>'
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Show All Segments", "ts_visual_composer_extend" ),
				"param_name"            => "showall",
				"value"                 => "false",
				"description"           => __( "Switch the toggle if you want to show all title segments once all animations have finished.", "ts_visual_composer_extend" ),
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Show All Delay", "ts_visual_composer_extend" ),
				"param_name"            => "showdelay",
				"value"                 => "1000",
				"min"                   => "0",
				"max"                   => "10000",
				"step"                  => "100",
				"unit"                  => 'ms',
				"description"           => __( "Define the delay before all title strings should be shown, after the last animation has finished.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "showall", 'value' => 'true' ),
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Show All Linebreaks", "ts_visual_composer_extend" ),
				"param_name"            => "showbreaks",
				"value"                 => "1",
				"min"                   => "0",
				"max"                   => "3",
				"step"                  => "1",
				"unit"                  => '',
				"description"           => __( "Define the number of line breaks between each segment when showing all title strings.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "showall", 'value' => 'true' ),
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Use on Mobile", "ts_visual_composer_extend" ),
				"param_name"            => "mobile",
				"value"                 => "false",
				"admin_label"			=> true,
				"description"           => __( "Switch the toggle if you want to show the animation on mobile devices.", "ts_visual_composer_extend" ),
			),
			array(
				"type"              	=> "dropdown",
				"heading"           	=> __( "Alternative Wrapper", "ts_visual_composer_extend" ),
				"param_name"        	=> "wrapper",
				"width"             	=> 150,
				"value"             	=> array(
					__( "H1", "ts_visual_composer_extend" )                      	=> "h1",
					__( "H2", "ts_visual_composer_extend" )                    		=> "h2",
					__( "H3", "ts_visual_composer_extend" )                   		=> "h3",
					__( "H4", "ts_visual_composer_extend" )                   		=> "h4",
					__( "H5", "ts_visual_composer_extend" )                   		=> "h5",
					__( "H6", "ts_visual_composer_extend" )                   		=> "h6",
				),
				"dependency"        	=> array( 'element' => "mobile", 'value' => 'false' ),
				"description"       	=> __( "Select the alternative wrapper for the title to be used on mobile devices.", "ts_visual_composer_extend" )
			),
			array(
				"type"              	=> "textfield",
				"heading"           	=> __( "Alternative Title", "ts_visual_composer_extend" ),
				"param_name"        	=> "title_mobile",
				"value"             	=> "",
				"dependency"        	=> array( 'element' => "mobile", 'value' => 'false' ),
				"description"       	=> __( "Provide an alternative title to be used on mobile devices.", "ts_visual_composer_extend" )
			),
			// Animation Settings
			array(
				"type"              	=> "seperator",
				"param_name"        	=> "seperator_2",
				"seperator"				=> "Typing Setting",
				"group" 				=> "Typing Settings",
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Trigger on Viewport", "ts_visual_composer_extend" ),
				"param_name"            => "viewport",
				"value"                 => "true",
				"admin_label"			=> true,
				"description"           => __( "Switch the toggle if you want the animation to be triggered upon viewport entry.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Start Delay", "ts_visual_composer_extend" ),
				"param_name"            => "startdelay",
				"value"                 => "0",
				"min"                   => "0",
				"max"                   => "10000",
				"step"                  => "1",
				"unit"                  => 'ms',
				"description"           => __( "Define the start delay before the animation begins with the first segment.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Type Speed", "ts_visual_composer_extend" ),
				"param_name"            => "typespeed",
				"value"                 => "10",
				"min"                   => "0",
				"max"                   => "1000",
				"step"                  => "1",
				"unit"                  => '',
				"admin_label"			=> true,
				"description"           => __( "Define the typing speed for each segment; the higher the value, the slower.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Back Delay", "ts_visual_composer_extend" ),
				"param_name"            => "backdelay",
				"value"                 => "500",
				"min"                   => "0",
				"max"                   => "10000",
				"step"                  => "1",
				"unit"                  => 'ms',
				"description"           => __( "Define the back delay before the animation moves to the next segment.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Back Speed", "ts_visual_composer_extend" ),
				"param_name"            => "backspeed",
				"value"                 => "10",
				"min"                   => "0",
				"max"                   => "1000",
				"step"                  => "1",
				"unit"                  => '',
				"admin_label"			=> true,
				"description"           => __( "Define the back space speed for each segment; the higher the value, the slower.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),				
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Loop Animation", "ts_visual_composer_extend" ),
				"param_name"            => "loop",
				"value"                 => "false",
				"admin_label"			=> true,
				"description"           => __( "Switch the toggle if you want to loop the typing animation.", "ts_visual_composer_extend" ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Loop Count", "ts_visual_composer_extend" ),
				"param_name"            => "loopcount",
				"value"                 => "0",
				"min"                   => "0",
				"max"                   => "99",
				"step"                  => "1",
				"unit"                  => '',
				"description"           => __( "Define how many times the animation should be looped; set to '0' (zero) for infinite loops.", "ts_visual_composer_extend" ),
				"dependency"            => array( 'element' => "loop", 'value' => 'true' ),
				"group" 				=> "Typing Settings",
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Show Cursor", "ts_visual_composer_extend" ),
				"param_name"            => "showcursor",
				"value"                 => "true",
				"description"           => __( "Switch the toggle if you want to show a typing cursor.", "ts_visual_composer_extend" ),
				"edit_field_class"		=> "vc_col-sm-6 vc_column",	
				"group" 				=> "Typing Settings",
			),
			array(
				"type"              	=> "switch_button",
				"heading"               => __( "Remove Cursor", "ts_visual_composer_extend" ),
				"param_name"            => "removecursor",
				"value"                 => "false",
				"description"           => __( "Switch the toggle if you want to remove the typing cursor once all animations have finished.", "ts_visual_composer_extend" ),
				"dependency"            => array( 'element' => "showcursor", 'value' => 'true' ),
				"edit_field_class"		=> "vc_col-sm-6 vc_column",	
				"group" 				=> "Typing Settings",
			),
			// Style Settings
			array(
				"type"              	=> "seperator",
				"param_name"        	=> "seperator_3",
				"seperator"				=> "Style Settings",
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "switch_button",
				"heading"           	=> __( "Add Line Effect", "ts_visual_composer_extend" ),
				"param_name"        	=> "title_lines",
				"value"             	=> "false",
				"description"       	=> __( "Switch the toggle if you want to add lines before and after the title.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "fontsmanager",
				"heading"           	=> __( "Font Family", "ts_visual_composer_extend" ),
				"param_name"        	=> "font_family",
				"value"             	=> "",
				"default"				=> "true",
				"connector"				=> "font_type",
				"description"       	=> __( "Select the font to be used for the title text.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "hidden_input",
				"param_name"        	=> "font_type",
				"value"             	=> "",
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "nouislider",
				"heading"           	=> __( "Font Size", "ts_visual_composer_extend" ),
				"param_name"        	=> "font_size",
				"value"             	=> "36",
				"min"               	=> "16",
				"max"               	=> "512",
				"step"              	=> "1",
				"unit"              	=> 'px',
				"admin_label"			=> true,
				"description"       	=> __( "Select the font size for the animated text.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "colorpicker",
				"heading"           	=> __( "Prefix Font Color", "ts_visual_composer_extend" ),
				"param_name"        	=> "fixed_color",
				"value"             	=> "#000000",
				"description"      	 	=> __( "Define the font color for the fixed pre-text.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "fixed_addition", 'value' => 'true' ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "colorpicker",
				"heading"           	=> __( "Segment Font Color", "ts_visual_composer_extend" ),
				"param_name"        	=> "font_color",
				"value"             	=> "#000000",
				"description"      	 	=> __( "Define the font color for the animated text.", "ts_visual_composer_extend" ),
				"edit_field_class"		=> "vc_col-sm-6 vc_column",	
				"group" 				=> "Style Settings",
			),			
			array(
				"type"              	=> "colorpicker",
				"heading"           	=> __( "Cursor Color", "ts_visual_composer_extend" ),
				"param_name"        	=> "cursorcolor",
				"value"             	=> "#cccccc",
				"description"      	 	=> __( "Define the color for the animated cursor.", "ts_visual_composer_extend" ),
				"dependency"            => array( 'element' => "showcursor", 'value' => 'true' ),
				"edit_field_class"		=> "vc_col-sm-6 vc_column",	
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "colorpicker",
				"heading"           	=> __( "Postfix: Font Color", "ts_visual_composer_extend" ),
				"param_name"        	=> "post_color",
				"value"             	=> "#000000",
				"description"      	 	=> __( "Define the font color for the fixed post-text.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "post_addition", 'value' => 'true' ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "colorpicker",
				"heading"           	=> __( "Mobile Color", "ts_visual_composer_extend" ),
				"param_name"        	=> "mobile_color",
				"value"             	=> "#000000",
				"description"      	 	=> __( "Define the color for the alternative mobile title.", "ts_visual_composer_extend" ),
				"dependency"        	=> array( 'element' => "mobile", 'value' => 'false' ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"              	=> "dropdown",
				"heading"           	=> __( "Font Weight", "ts_visual_composer_extend" ),
				"param_name"        	=> "font_weight",
				"width"             	=> 150,
				"value"             	=> array(
					__( 'Default', "ts_visual_composer_extend" )  => "inherit",
					__( 'Bold', "ts_visual_composer_extend" )     => "bold",
					__( 'Bolder', "ts_visual_composer_extend" )   => "bolder",
					__( 'Normal', "ts_visual_composer_extend" )   => "normal",
					__( 'Light', "ts_visual_composer_extend" )    => "300",
				),
				"description"       	=> __( "Select the font weight for the animated text.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"					=> "image_selector",
				"heading"				=> __( "Text Align", "ts_visual_composer_extend" ),
				"param_name"			=> "font_align",
				"template"				=> "alignfull",
				"value"					=> "center",
				"edit_field_class"		=> "vc_col-sm-6 vc_column",
				"description"       	=> __( "Select the alignment for the animated text.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),
			array(
				"type"                  => "nouislider",
				"heading"               => __( "Left / Right Padding", "ts_visual_composer_extend" ),
				"param_name"            => "padding",
				"value"                 => "15",
				"min"                   => "0",
				"max"                   => "100",
				"step"                  => "1",
				"unit"                  => 'px',
				"description"           => __( "Define the left/right padding for the title.", "ts_visual_composer_extend" ),
				"group" 				=> "Style Settings",
			),			
			// Other Settings
			array(
				"type"              	=> "seperator",
				"param_name"        	=> "seperator_4",
				"seperator"             => "Other Settings",
				"group" 				=> "Other Settings",
			),
			array(
				"type"              	=> "nouislider",
				"heading"           	=> __( "Margin: Top", "ts_visual_composer_extend" ),
				"param_name"        	=> "margin_top",
				"value"             	=> "0",
				"min"               	=> "-50",
				"max"               	=> "200",
				"step"              	=> "1",
				"unit"              	=> 'px',
				"description"       	=> __( "Select the top margin for the element.", "ts_visual_composer_extend" ),
				"group" 				=> "Other Settings",
			),
			array(
				"type"              	=> "nouislider",
				"heading"           	=> __( "Margin: Bottom", "ts_visual_composer_extend" ),
				"param_name"        	=> "margin_bottom",
				"value"             	=> "0",
				"min"               	=> "-50",
				"max"               	=> "200",
				"step"              	=> "1",
				"unit"              	=> 'px',
				"description"       	=> __( "Select the bottom margin for the element.", "ts_visual_composer_extend" ),
				"group" 				=> "Other Settings",
			),
			array(
				"type"              	=> "textfield",
				"heading"           	=> __( "Define ID Name", "ts_visual_composer_extend" ),
				"param_name"        	=> "el_id",
				"value"             	=> "",
				"description"       	=> __( "Enter an unique ID for the element.", "ts_visual_composer_extend" ),
				"group" 				=> "Other Settings",
			),
			array(
				"type"                  => "tag_editor",
				"heading"           	=> __( "Extra Class Names", "ts_visual_composer_extend" ),
				"param_name"            => "el_class",
				"value"                 => "",
				"description"      		 => __( "Enter additional class names for the element.", "ts_visual_composer_extend" ),
				"group" 				=> "Other Settings",
			),
		)
	);	
	if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VisualComposer_LeanMap == "true") {
		return $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VisualComposer_Element;
	} else {			
		vc_map($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VisualComposer_Element);
	};
?>